微信小程序错误信息之canvasToTempFilePath: fail canvas is empty
wowkaka:
[code=javascript]
setTimeout(() => {
_this.ctx.draw(false, setTimeout(() => {
console.log("_this.canvasStyle", _this.canvasStyle)
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
quality: 1,
// x: 0,
// y: 0,
// destWidth: 2479,
// destHeight: 3508,
success: (res)=> {
// 在H5平台下,tempFilePath 为 base64
resolve(res.tempFilePath)
console.log('生成的路径')
uni.uploadFile({
url: _this.$url.upload,
filePath: res.tempFilePath,
name: 'file',
header: {
token: _this.$store.state.token,
version: '10.00.0'
},
success: (res)=>{
console.log("resshangchuanchenggong", JSON.parse(res.data).url)
console.log("_this.useHeight", _this.useHeight)
_this.$emit('detailUrl', {url:JSON.parse(res.data).url, goodsLength: _this.goodsList.length})
},
fail: (res)=> {
[/code]
|